package com.example.healthsystem.config;

import com.example.healthsystem.model.vo.Result;
import com.example.healthsystem.util.JacksonUtils;
//import org.springframework.security.core.AuthenticationException;
//import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

//@Component
//public class MyAuthenticationEntryPoint implements AuthenticationEntryPoint {
//    @Override
//    public void commence(HttpServletRequest request,
//                         HttpServletResponse response,
//                         AuthenticationException exception)
//            throws IOException, ServletException {
//        response.setContentType("application/json;charset=utf-8");
//        PrintWriter out = response.getWriter();
//        Result result = Result.create(403, "请登录");
//        out.write(JacksonUtils.writeValueAsString(result));
//        out.flush();
//        out.close();
//    }
//}
public class MyAuthenticationEntryPoint{

}
